package com.lingnan.service.impl;

import com.lingnan.mapper.ChatMessageMapper;
import com.lingnan.service.ChatSessionService;
import com.lingnan.service.MessageReadService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class MessageReadServiceImpl implements MessageReadService {
    @Resource
    private ChatMessageMapper messageMapper;
    @Resource
    private ChatSessionService chatSessionService;

    @Override
    @Transactional
    public void markMessagesAsRead(Long sessionId, Long userId, Integer userType) {
        int count = messageMapper.markMessagesAsRead(sessionId, userId, userType);
        log.info("标记{}条消息为已读", count);

    }
}